<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Authenticate extends MX_Controller {

    function __construct() {
        parent::__construct();
        $this->load->model('admin_model');
        if (!$this->session->userdata('admin')) {
            $this->session->set_flashdata('error', 'Restricted Place');
            redirect(site_url("admin/authenticate/"));
        }
        $urlKey = $this->input->getParam('key');
        $sessionKey = $this->session->userdata('sessionKey');
        if ($urlKey !== $sessionKey) {
            $this->session->set_flashdata('error', 'Restricted Place');
            redirect(site_url("admin/authenticate/"));
        }
    }

    protected function _eventLoadLayout() {
        $this->page['meta_desc'] = 'Administrator';
        $this->page['meta_keywords'] = 'Administrator';
        $this->page['author'] = 'HardTV99';
        $this->page['index'] = 'NO INDEX, NO FOLLOW';
        $this->page['title'] = 'Administrator';
        $this->page['content'] = 'Default Content';
    }

}
